using System;
using System.Collections.Generic;
using System.Text;
using Gremlin.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;

namespace Squadron
{
    class LaserGun : Gun
    {
        public LaserGun(Microsoft.Xna.Framework.Game game, ContentManager content, string modelName,
            String projectileMeshName, uint damage, int firingCooldown)
            : base(game, content, modelName)
        {
            contentManager = content;
            this.projectileMeshName = projectileMeshName;
            this.damage = damage;
            this.firingCooldown = firingCooldown;
        }

        #region Gun Members

        public override Projectile Fire(Quaternion rotation)
        {
            if (coolDownTimer <= 0)
            {
                // Create a new laser.
                Laser laser = new Laser(_game, contentManager, projectileMeshName, rotation, 1000, damage, 10.0f);
                laser.Position = this.Position;
                coolDownTimer = firingCooldown;

                return laser;
            }
            else
                return null;
        }

        #endregion

               
    }
}
